/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lenovo
 * Date: 2022-06-27
 * Time: 9:00
 */
public class Overload1 {
    public static void main(String[] args) {

        //只要传递进去不同的参数，就会调用对应的方法
        //此时区分方法不在依靠方法名，而是依靠实参的数据类型
        System.out.println(sum(1,2));
        System.out.println(sum(1L,2L));
        System.out.println(sum(1.0,2.0));
    }
    public static int sum(int a,int b){
        return a+b;
    }
    public static double sum(double a,double b){
        return a+b;
    }
    public static long sum(long a,long b){
        return a+b;
    }
}
